home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 2 #3
/
Commodore_Disk_User_Vol.2_3_1989_-_Side_B.d64
/
opcode scanner
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
14KB
|
551 lines
1 rem**********************************
2 rem* **
3 rem* opcode....by paul rathbone. **
4 rem* **
5 rem* for commodore disk user **
6 rem* **
7 rem* copyright july 1988 **
8 rem**********************************
9 rem**********************************
10 if a=0 then a=1:load"op",8,1
15 dim ye$(51):close1:open1,4
20 gosub 12000:rem************arrays***
25 lx=0:gosub4000
30 gosub9200:gosub7900:gosub7300:rem*cls******scr/prt***
40 if pr$="p" then gosub5400
100 gosub9200:for y=1 to 7
110 on y gosub 1000,1100,1200,1300,1400,1500,1600
120 gosub 7200:rem**************wait***
130 gosub 9200:rem***************cls***
140 next y
150 gosub 6400
160 if me=1 then gosub5800:me=0
170 if me=2 then gosub6600:me=0
180 if me=3 then goto25
190 if me=4 then sys64738
200 goto150
1000 gosub 5600:rem******header(lax)***
1010 ll=10000:ad=49955:poke(ad+3),198
1020 for x=1 to 7
1030 gosub8500:rem**********line no.***
1040 on x gosub 10000,10010,10020,10030,10040,10050,10060
1050 gosub7000:rem******process vals***
1060 op$=lax$(x,1):gosub7500
1070 gosub5200:rem********print vals***
1080 nextx:if pr$="p" thenprint#1,""
1090 return
1100 gosub5600:rem*******header(as0)***
1110 ll=10100:poke(ad+2),175
1120 forx=1 to 7
1130 gosub8500:rem**********line no.***
1140 on x gosub 10100,10110,10120,10130,10140,10150,10160
1150 gosub7100:rem****process vals****
1160 op$=aso$(x,1):gosub7500
1170 gosub5000:rem********print vals***
1180 nextx:if pr$="p" thenprint#1,""
1190 return
1200 gosub5600:rem*******header(rla)***
1210 ll=10200
1212 if ca$="s" then poke (ad+2),3
1216 if ca$="c" then poke (ad+2),2
1220 forx=1 to 8
1230 gosub8500:rem**********line no.***
1240 on x gosub 10200,10210,10220,10230,10240,10250,10260,10270
1250 gosub7100:rem******process vals***
1260 op$=rla$(x,1):gosub7500
1270 gosub5000:rem********print vals***
1280 nextx:if pr$="p" thenprint#1,""
1290 return
1300 gosub5600:rem*******header(ins)***
1310 ll=10300
1312 if ca$="s" then poke (ad+2),32
1316 if ca$="c" then poke (ad+2),31
1320 forx=1 to 7
1330 gosub8500:rem**********line no.***
1340 on x gosub 10300,10310,10320,10330,10340,10350,10360
1350 gosub7100:rem******process vals***
1360 op$=ins$(x,1):gosub7500
1370 gosub5000:rem********print vals***
1380 nextx:if pr$="p" thenprint#1,""
1390 return
1400 gosub5600:rem*******header(lse)***
1410 ll=10400:poke(ad+2),45
1420 forx=1 to 7
1430 gosub8500:rem**********line no.***
1440 on x gosub 10400,10410,10420,10430,10440,10450,10460
1450 gosub7100:rem******process vals***
1460 op$=lse$(x,1):gosub7500
1470 gosub5000:rem********print vals***
1480 nextx:if pr$="p" thenprint#1,""
1490 return
1500 gosub5600:rem*******header(rra)***
1510 ll=10500
1512 if ca$="s" then poke (ad+2),178
1516 if ca$="c" then poke (ad+2),50
1520 forx=1 to 7
1530 gosub8500:rem****line no.****
1540 on x gosub 10500,10510,10520,10530,10540,10550,10560
1550 gosub7100:rem******process vals***
1560 op$=rra$(x,1):gosub7500
1570 gosub5000:rem********print vals***
1580 nextx:if pr$="p" thenprint#1,""
1590 return
1600 gosub5600:rem******header(axs+)***
1610 ll=10600:poke(ad+2),5
1620 forx=1 to 8
1630 gosub8500:rem**********line no.***
1640 on x gosub 10600,10610,10620,10630,10640,10650,10660,10670
1650 gosub7100:rem******process vals***
1660 op$=axs$(x,1):gosub7500
1670 gosub5000:rem********print vals***
1680 nextx:if pr$="p" thenprint#1,""
1690 return
4000 rem*************set/clear carry***
4010 gosub9200
4020 print" ";
4030 printchr$(18);"c";chr$(146);"lear carry?";:if ca$="c" thenprint"_";
4035 print:print
4040 print" or":print
4050 print" ";
4060 printchr$(18);"s";chr$(146);"et carry ";:if ca$="s" thenprint"_";
4070 get ca$:ifca$=""then4070
4080 if ca$="s" then poke49972,56:poke49984,56:return
4090 if ca$="c" then poke49972,24:poke49984,24:return
4095 goto4070
4100 rem*******print carry clear/set***
4110 print"[145][145]";
4120 if ca$="c" then print"carry clear":print:print:return
4130 if ca$="s" then print"carry set":print:print:return
4140 print"err":print:print:return
5000 rem***(rest)******output values***
5010 cc=0:gosub 5100
5020 printop$;
5030 cc=14:gosub 5100
5040 printfl$;
5050 cc=22:gosub 5100
5060 printac;
5070 cc=33:gosub 5100
5080 printex:if pr$="p" then gosub5700
5090 return
5100 rem***********set cursor column***
5110 poke780,0:poke782,cc
5120 poke 781,peek(214)
5130 sys (58636)
5140 return
5200 rem***(lax)*******output values***
5210 cc=0:gosub 5100
5220 printop$;
5230 cc=14:gosub 5100
5240 printfl$;
5250 cc=20:gosub 5100
5260 printac;
5270 cc=25:gosub 5100
5280 printa1;
5290 cc=33:gosub 5100
5300 printex:if pr$="p" then gosub5500
5310 return
5400 rem**************printer header***
5405 if ca$="s" then print#1,"",,,"carry set"
5410 if ca$="c" then print#1,"",,,"carry clear"
5420 print#1,"",
5430 print#1,"opcode",
5440 print#1,"o.k.?",
5450 print#1,"actual",
5460 print#1,"target"
5470 print#1,"****************************************************************";
5480 print#1,"**********"
5490 return
5500 rem****(lax)*****printer output***
5510 print#1," ";op$,
5520 print#1," ";fl$,
5530 print#1," ";ac;
5540 print#1," ";a1,
5550 print#1,ex
5560 return
5600 rem***************screen header***
5610 gosub9200:gosub4100
5620 print" opcode o.k.? actual target"
5630 return
5700 rem****(rest)****printer output***
5710 print#1," ";op$,
5720 print#1," ";fl$,
5730 print#1," ";ac,
5740 print#1,ex
5750 return
5800 rem**operative code print*********
5810 gosub9200
5820 gosub7950
5830 gosub7300
5840 if pr$="s" then gosub7600:gosub7700:return
5850 if pr$="p" then gosub7800:gosub7850:gosub7600:gosub7700
5860 return
6000 rem*ass'r notation header (scr)***
6010 print" instruction assembler notation"
6020 return
6100 rem***(scr)instr & asr notation***
6105 gosub9200:gosub6000
6110 for x=1 to 7
6120 print" ";lax$(x,3);" ";lax$(x,2)
6130 nextx:print""
6135 gosub7200:gosub9200:gosub6000
6140 for x=1 to 7
6150 print" ";aso$(x,3);" ";aso$(x,2)
6160 nextx:print""
6165 gosub7200:gosub9200:gosub6000
6170 for x=1 to 8
6180 print" ";rla$(x,3);" ";rla$(x,2)
6190 nextx:print""
6195 gosub7200:gosub9200:gosub6000
6200 for x=1 to 7
6210 print" ";ins$(x,3);" ";ins$(x,2)
6220 nextx:print""
6225 gosub7200:gosub9200:gosub6000
6230 for x=1 to 7
6240 print" ";lse$(x,3);" ";lse$(x,2)
6250 nextx:print""
6255 gosub7200:gosub9200:gosub6000
6260 for x=1 to 7
6270 print" ";rra$(x,3);" ";rra$(x,2)
6280 nextx:print""
6285 gosub7200:gosub9200:gosub6000
6290 for x=1 to 8
6300 print" ";axs$(x,3);" ";axs$(x,2)
6310 nextx:print""
6315 gosub7200
6320 return
6400 rem***************menu - working codes/all codes plus assembler notation***
6410 gosub9200
6420 print"[145][145]":cc=16:gosub5100
6430 printchr$(18);
6440 print"menu";chr$(146);""
6450 print" 1. list successful codes.":print
6460 print" 2. list all codes + hex values.":print
6470 print" 3. restart program.":print
6480 print" 4. exit & initialise"
6490 get me$:if me$="" then6490
6500 me=val(me$):if me<1 then 6490
6510 if me>4 then 6490
6520 return
6600 rem**?all codes & hex vals"
6610 [141] 9200
6620 [141] 9000
6630 [141] 7300
6640 [139] pr$[178]"s" [167] [141]6000:[141]6100:[142]
6650 [139] pr$[178]"p" [167] [141]6700:[141]6000:[141]6100
6660 [142]
6700 [143]******(prt) header codes/hex***
6710 [152]1,"","instruction",,"assembler notation"
6720 [129] x[178]1 [164] 7
6730 [152]1,"",lax$(x,1),,lax$(x,2)
6740 [130]x:[152]1,""
6750 [129] x[178]1 [164] 7
6760 [152]1,"",aso$(x,1),,aso$(x,2)
6770 [130]x:[152]1,""
6780 [129] x[178]1 [164] 8
6790 [152]1,"",rla$(x,1),,rla$(x,2)
6800 [130]x:[152]1,""
6810 [129] x[178]1 [164] 7
6820 [152]1,"",ins$(x,1),,ins$(x,2)
6830 [130]x:[152]1,""
6840 [129] x[178]1 [164] 7
6850 [152]1,"",lse$(x,1),,lse$(x,2)
6860 [130]x:[152]1,""
6870 [129] x[178]1 [164] 7
6880 [152]1,"",rra$(x,1),,rra$(x,2)
6890 [130]x:[152]1,""
6900 [129] x[178]1 [164] 8
6910 [152]1,"",axs$(x,1),,axs$(x,2)
6920 [130]x:[152]1,""
6930 [142]
7000 [143]*****processing routine(lax)***
7010 [139] [194](ad)[178]1 [167] fl$[178]"yes":[137]7040
7020 [139] [194](ad)[178]0 [167] fl$[178]"no ":[137]7040
7030 fl$[178]"err"
7040 ex[178][194](ad[170]3)
7050 ac[178][194](ad[170]1)
7060 a1[178][194](ad[170]2)
7070 [142]
7100 [143]****processing routine(rest)***
7110 [139] [194](ad)[178]1 [167] fl$[178]"yes":[137]7140
7120 [139] [194](ad)[178]0 [167] fl$[178]"no ":[137]7140
7130 fl$[178]"err"
7140 ac[178][194](ad[170]1)
7150 ex[178][194](ad[170]2)
7160 [142]
7200 [143]*wait for key & print message**
7210 [153][199](18);
7220 [151]780,0:[151]781,23:[151]782,9:[158]65520
7230 [153]"press space for more";
7240 [153][199](146);
7250 [161]ik$:[139] ik$[179][177]" " [167]7250
7260 [153][199](146);
7270 [151]780,0:[151]781,23:[151]782,9:[158]65520
7280 [153]" ";
7290 [142]
7300 [143]***********screen or printer***
7320 [153]" ";
7330 [153][199](18);"s";
7340 [153][199](146);"creen or ";
7350 [153][199](18);"p";
7360 [153][199](146);"rinter ?"
7370 [161]pr$:[139] pr$[178]"" [167]7370
7380 [139] pr$[178]"s" [167] [142]
7390 [139] pr$[178]"p" [167] [137]7400
7395 [137] 7370
7400 [141]9200
7410 [153]"";
7420 [153]" please ensure that your printer"
7430 [153]" is switched on and ready."
7440 [153]" press any key."
7480 [161]ix$:[139] ix$[178]"" [167]7480
7490 [142]
7500 [143]********get successful tests***
7510 [139] fl$[178]"no " [167] [142]
7520 ye$(lx)[178]op$
7530 lx[178]lx[170]1
7540 [142]
7600 [143]*(scr)*header for pos' tests***
7610 [141] 9200
7620 [153]"";
7630 [153]" operative codes"
7640 [142]
7700 [143]**(scr)******print pos tests***
7710 [139] ca$[178]"c" [167] [153]" carry clear":[153]
7720 [139] ca$[178]"s" [167] [153]" carry set":[153]
7730 [153]
7740 [129] za[178]0 [164] lx
7750 [153]" ";ye$(za)
7760 [130] za:[141]7200
7770 [142]
7800 [143]*(prt)*header for pos' tests***
7810 [152]1," operative opcodes"
7820 [139] ca$[178]"c" [167] [152]1," (carry clear)"
7830 [139] ca$[178]"s" [167] [152]1," (carry set)"
7840 [153]:[142]
7850 [143]**(prt)******print pos tests***
7860 [129] za[178]0 [164] lx
7870 [152]1," ";ye$(za)
7880 [130] za
7890 [142]
7900 [143]********print"full res'table***
7910 print" full result table"
7920 return
7950 rem*****?"operative codes"
7960 print" successful codes"
7970 return
8500 rem***************print lne no.***
8510 li=ll+(x*10)-10
8520 printli;
8530 return
9000 rem*****?"codes & values"
9010 print" all codes & values"
9020 return
9200 rem*********clear screen & home***
9210 printchr$(19);chr$(147);
9230 print"";:return
10000 sys49152:return:rem lax1
10010 sys49167:return:rem lax2
10020 sys49184:return:rem lax3
10030 sys49201:return:rem lax4
10040 sys49215:return:rem lax5
10050 sys49231:return:rem lax6
10060 sys49250:return:rem lax7
10100 sys49269:return:rem aso1
10110 sys49282:return:rem aso2
10120 sys49297:return:rem aso3
10130 sys49312:return:rem aso4
10140 sys49324:return:rem aso5
10150 sys49338:return:rem aso6
10160 sys49355:return:rem aso7
10200 sys49372:return:rem rla1
10210 sys49385:return:rem rla2
10220 sys49400:return:rem rla3
10230 sys49415:return:rem rla4
10240 sys49427:return:rem rla5
10250 sys49441:return:rem rla6
10260 sys49458:return:rem rla7
10270 sys49475:return:rem rla8
10300 sys49489:return:rem ins1
10310 sys49499:return:rem ins2
10320 sys49514:return:rem ins3
10330 sys49529:return:rem ins4
10340 sys49541:return:rem ins5
10350 sys49555:return:rem ins6
10360 sys49572:return:rem ins7
10400 sys49589:return:rem lse1
10410 sys49602:return:rem lse2
10420 sys49617:return:rem lse3
10430 sys49632:return:rem lse4
10440 sys49644:return:rem lse5
10450 sys49658:return:rem lse6
10460 sys49675:return:rem lse7
10500 sys49692:return:rem rra1
10510 sys49705:return:rem rra2
10520 sys49720:return:rem rra3
10530 sys49735:return:rem rra4
10540 sys49747:return:rem rra5
10550 sys49761:return:rem rra6
10560 sys49778:return:rem rra7
10600 sys49795:return:rem axs1
10610 sys49817:return:rem axs2
10620 sys49831:return:rem axs3
10630 sys49847:return:rem axs4
10640 pokead+2,0:sys49874:return:rem stz1
10650 pokead+2,2:sys49892:return:rem alr1
10660 pokead+2,128:sys49903:return:rem sax1
10670 pokead+2,5:sys49917:return:rem tad1
12000 lax$(1,1)="lax abs "
12005 lax$(1,2)=".byt $af,$fe,$02"
12007 lax$(1,3)="lax $02fe "
12010 lax$(2,1)="lax abs,x "
12015 lax$(2,2)=".byt $df,fb,$02"
12017 lax$(2,3)="lax $02fb,x"
12020 lax$(3,1)="lax abs,y "
12025 lax$(3,2)=".byt $db,$fb,$02"
12027 lax$(3,3)="lax $02fb,y"
12030 lax$(4,1)="lax zero "
12035 lax$(4,2)=".byt $c7,$fe"
12037 lax$(4,3)="lax $fe "
12040 lax$(5,1)="lax zero,x "
12045 lax$(5,2)=".byt $d7,$fb"
12047 lax$(5,3)="lax $fb,x "
12050 lax$(6,1)="lax (ind,x)"
12055 lax$(6,2)=".byt $c3,$fb"
12057 lax$(6,3)="lax ($fb,x)"
12060 lax$(7,1)="lax (ind,y)"
12065 lax$(7,2)=".byt $d3,$fb"
12067 lax$(7,3)="lax ($fb,y)"
12100 aso$(1,1)="aso abs "
12105 aso$(1,2)=".byt $0f,$fe,$02"
12107 aso$(1,3)="aso $02fe "
12110 aso$(2,1)="aso abs,x "
12115 aso$(2,2)=".byt $1f,$fb,$02"
12117 aso$(2,3)="aso $02fb,x"
12120 aso$(3,1)="aso abs,y "
12125 aso$(3,2)=".byt $1b,$fb,$02"
12127 aso$(3,3)="aso $02fb,y"
12130 aso$(4,1)="aso zero "
12135 aso$(4,2)=".byt $07,$fe"
12137 aso$(4,3)="aso $fe "
12140 aso$(5,1)="aso zero,x "
12145 aso$(5,2)=".byt $17,$fb"
12147 aso$(5,3)="aso $fe,y "
12150 aso$(6,1)="aso (ind,x)"
12155 aso$(6,2)=".byt $03,$fb"
12157 aso$(6,3)="aso ($fb,x)"
12160 aso$(7,1)="aso (ind,y)"
12165 aso$(7,2)=".byt $0b,$fb"
12167 aso$(7,3)="aso ($fb,y)"
12200 rla$(1,1)="rla abs "
12205 rla$(1,2)=".byt $2f,$fe,$02"
12207 rla$(1,3)="rla $02fe "
12210 rla$(2,1)="rla abs,x "
12215 rla$(2,2)=".byt $3f,$fb,$02"
12217 rla$(2,3)="rla $02fb,x"
12220 rla$(3,1)="rla abs,y "
12225 rla$(3,2)=".byt $3b,$fb,$02"
12227 rla$(3,3)="rla $02fb,y"
12230 rla$(4,1)="rla zero "
12235 rla$(4,2)=".byt $27,$fe"
12237 rla$(4,3)="rla $fe "
12240 rla$(5,1)="rla zero,x "
12245 rla$(5,2)=".byt $37,$fb"
12247 rla$(5,3)="rla $fb,x "
12250 rla$(6,1)="rla (ind,x)"
12255 rla$(6,2)=".byt $23,$fb"
12257 rla$(6,3)="rla ($fb,x)"
12260 rla$(7,1)="rla (ind,y)"
12265 rla$(7,2)=".byt $33,$fb"
12267 rla$(7,3)="rla ($fb,y)"
12270 rla$(8,1)="rla imm "
12275 rla$(8,2)=".byt $2b,$55"
12277 rla$(8,3)="rla #$55 "
12300 ins$(1,1)="ins abs "
12305 ins$(1,2)=".byt $ef,$fe,$02"
12307 ins$(1,3)="ins $02fe "
12310 ins$(2,1)="ins abs,x "
12315 ins$(2,2)=".byt $ff,$fb,$02"
12317 ins$(2,3)="ins $02fb,x"
12320 ins$(3,1)="ins abs,y "
12325 ins$(3,2)=".byt $fb,$fb,$02"
12327 ins$(3,3)="ins $02fb,y"
12330 ins$(4,1)="ins zero "
12335 ins$(4,2)=".byt $e7,$fe"
12337 ins$(4,3)="ins $fe "
12340 ins$(5,1)="ins zero,x "
12345 ins$(5,2)=".byt $f7,$fb"
12347 ins$(5,3)="ins $fb,x "
12350 ins$(6,1)="ins (ind,x)"
12355 ins$(6,2)=".byt $e3,$fb"
12357 ins$(6,3)="ins ($fb,x)"
12360 ins$(7,1)="ins (ind,y)"
12365 ins$(7,2)=".byt $f3,$fb"
12367 ins$(7,3)="ins ($fb,y)"
12400 lse$(1,1)="lse abs "
12405 lse$(1,2)=".byt $4f,$fe,$02"
12407 lse$(1,3)="lse $02fe "
12410 lse$(2,1)="lse abs,x "
12415 lse$(2,2)=".byt $5f,$fb,$02"
12417 lse$(2,3)="lse $02fb,x"
12420 lse$(3,1)="lse abs,y "
12425 lse$(3,2)=".byt $5b,$fb,$02"
12427 lse$(3,3)="lse $02fb,y"
12430 lse$(4,1)="lse zero "
12435 lse$(4,2)=".byt $47,$fe"
12437 lse$(4,3)="lse $fe "
12440 lse$(5,1)="lse zero,x "
12445 lse$(5,2)=".byt $57,$fb"
12447 lse$(5,3)="lse $fb,x "
12450 lse$(6,1)="lse (ind,x)"
12455 lse$(6,2)=".byt $43,$fb"
12457 lse$(6,3)="lse ($fb,x)"
12460 lse$(7,1)="lse (ind,y)"
12465 lse$(7,2)=".byt $53,$fb"
12467 lse$(7,3)="lse ($fb,y)"
12500 rra$(1,1)="rra abs "
12505 rra$(1,2)=".byt $6f,$fe,$02"
12507 rra$(1,3)="rra $02fe "
12510 rra$(2,1)="rra abs,x "
12515 rra$(2,2)=".byt $7f,$fb,$02"
12517 rra$(2,3)="rra $02fb,x"
12520 rra$(3,1)="rra abs,y "
12525 rra$(3,2)=".byt $7b,$fb,$02"
12527 rra$(3,3)="rra $02fb,y"
12530 rra$(4,1)="rra zero "
12535 rra$(4,2)=".byt $67,$fe"
12537 rra$(4,3)="rra $fe "
12540 rra$(5,1)="rra zero,x "
12545 rra$(5,2)=".byt $77,$fb"
12547 rra$(5,3)="rra $fb,x "
12550 rra$(6,1)="rra (ind,x)"
12555 rra$(6,2)=".byt $63,$fb"
12557 rra$(6,3)="rra ($fb,x)"
12560 rra$(7,1)="rra (ind,y)"
12565 rra$(7,2)=".byt $73,$fb"
12567 rra$(7,3)="rra ($fb,y)"
12600 axs$(1,1)="axs abs "
12605 axs$(1,2)=".byt $8f,$fe,$02"
12607 axs$(1,3)="axs $02fe "
12610 axs$(2,1)="axs zero "
12615 axs$(2,2)=".byt $87,$fe"
12617 axs$(2,3)="axs $fe "
12620 axs$(3,1)="axs zero,y "
12625 axs$(3,2)=".byt $97,$fb"
12627 axs$(3,3)="axs $fb,y "
12630 axs$(4,1)="axs (ind,x)"
12635 axs$(4,2)=".byt $83,$fb"
12637 axs$(4,3)="axs $fb,x "
12640 axs$(5,1)="stz abs "
12645 axs$(5,2)=".byt $9c,$fe,$02
12647 axs$(5,3)[178]"stz $02fe "
12650 axs$(6,1)[178]"alr imm "
12655 axs$(6,2)[178]".byt $4b,$07"
12657 axs$(6,3)[178]"alr #$07 "
12660 axs$(7,1)[178]"sax imm "
12665 axs$(7,2)[178]".byt $cb,$20"
12667 axs$(7,3)[178]"axs #$20 "
12670 axs$(8,1)[178]"tad abs "
12675 axs$(8,2)[178]".byt $8b,$20"
12677 axs$(8,3)[178]"tad #$20 "
12680 [142]